<!doctype html>
<html>
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width" />

  <title>horizontal order</title>

  <style>
  * { box-sizing: border-box; }

  body { font-family: sans-serif; }

  .grid {
    background: #DDD;
    max-width: 900px;
    margin-bottom: 60px;
  }

  .grid-item {
    float: left;
    width: 150px;
    height: 150px;
    border: 1px solid #333;
    color: white;
    font-size: 20px;
    background: #19F;
    counter-increment: grid-item;
  }

  .grid-item:before {
    content: counter(grid-item);
    padding: 10px;
  }

  .grid-item--width2 { width: 300px; }
  .grid-item--width3 { width: 450px; }

  .grid-item--height2 { height: 200px; }
  .grid-item--height3 { height: 250px; }

  .grid-item.is-zero { height: 0; border: none; }

  .stamp {
    border: 1px solid #333;
    background: #E21;
    position: absolute;
  }

  .stamp--1 {
    width: 300px;
    height: 200px;
    right: 0;
    top: 0;
  }
  </style>

</head>
<body>

  <h1>horizontal order</h1>

<div class="grid grid--1">
  <div class="grid-item"></div>
  <div class="grid-item grid-item--height3"></div>
  <div class="grid-item grid-item--height2"></div>
  <div class="grid-item"></div>
  <div class="grid-item"></div>
  <div class="grid-item grid-item--height2"></div>
  <div class="grid-item"></div>
  <div class="grid-item is-zero"></div>
  <div class="grid-item grid-item--width2"></div>
  <div class="grid-item grid-item--height3"></div>
  <div class="grid-item grid-item--width3"></div>
  <div class="grid-item"></div>
  <div class="grid-item"></div>
  <div class="grid-item grid-item--height2"></div>
  <div class="grid-item"></div>
  <div class="grid-item"></div>
  <div class="grid-item grid-item--width3"></div>
  <div class="grid-item grid-item--height2"></div>
  <div class="grid-item"></div>
  <div class="grid-item"></div>
  <div class="grid-item grid-item--height2"></div>
  <div class="grid-item"></div>
</div>

<div class="grid grid--2">
  <div class="grid-item"></div>
  <div class="grid-item grid-item--height3"></div>
  <div class="grid-item grid-item--height2"></div>
  <div class="grid-item"></div>
  <div class="grid-item grid-item--height2"></div>
  <div class="grid-item"></div>
  <div class="grid-item grid-item--height3"></div>
  <div class="grid-item"></div>
  <div class="grid-item"></div>
  <div class="grid-item grid-item--height3"></div>
  <div class="grid-item"></div>
  <div class="grid-item"></div>
  <div class="grid-item grid-item--height3"></div>
  <div class="grid-item grid-item--height2"></div>
  <div class="grid-item"></div>
  <div class="grid-item grid-item--height2"></div>
</div>

<div class="grid grid--3">
  <div class="stamp stamp--1"></div>
  <div class="grid-item"></div>
  <div class="grid-item grid-item--height3"></div>
  <div class="grid-item grid-item--height2"></div>
  <div class="grid-item"></div>
  <div class="grid-item grid-item--height2"></div>
  <div class="grid-item"></div>
  <div class="grid-item grid-item--height3"></div>
  <div class="grid-item"></div>
  <div class="grid-item"></div>
  <div class="grid-item grid-item--height2"></div>
  <div class="grid-item"></div>
  <div class="grid-item grid-item--height3"></div>
  <div class="grid-item"></div>
</div>

<script src="../bower_components/ev-emitter/ev-emitter.js"></script>
<script src="../bower_components/get-size/get-size.js"></script>
<script src="../bower_components/desandro-matches-selector/matches-selector.js"></script>
<script src="../bower_components/fizzy-ui-utils/utils.js"></script>
<script src="../bower_components/outlayer/item.js"></script>
<script src="../bower_components/outlayer/outlayer.js"></script>

<script src="../masonry.js"></script>

<script>
new Masonry( '.grid--1', {
  itemSelector: '.grid-item',
  horizontalOrder: true,
});

new Masonry( '.grid--2', {
  itemSelector: '.grid-item',
  horizontalOrder: true,
});

new Masonry( '.grid--3', {
  itemSelector: '.grid-item',
  horizontalOrder: true,
  stamp: '.stamp',
})
</script>

</body>
</html>
